import React from 'react'
import { useLocation } from  'react-router-dom'
import qs from 'qs'

export default function News() {
  //拿到路由信息
  const location = useLocation();

  const {name , age} = qs.parse(location.search.split("?")[1])

  return (
    <div>
      <h3>姓名:{name}</h3>
      <h3>年龄:{age}</h3>
    </div>
  )
}
